package com.wngz;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wngz.entity.User;
import com.wngz.mapper.UserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.util.StringUtils;

import java.util.List;

@SpringBootTest
public class UserMapperTest04 {

    @Autowired
    private UserMapper userMapper;


    @Test
    public void page(){
        Page<User> page = new Page<>(1,5);

        userMapper.selectPage(page, null);

        List<User> records = page.getRecords();
        records.forEach(System.out::println);

        long total = page.getTotal();
        System.out.println("total = " + total);

        long current = page.getCurrent();
        System.out.println("current = " + current);

        long pages = page.getPages();
        System.out.println("pages = " + pages);

    }

}
